<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/jquery.ui.css" />
<form class="layui-form">
    <table cellpadding="0" cellspacing="0" class="frame_form" width="100%">
        <tr>
            <th width="15%">ID：</th>
            <td width="35%">
                <div style="height:24px;line-height:24px;">{$member.u_id}</div>
            </td>
            <th width="15%">密码：</th>
            <td width="35%"><input type="password" class="input fl" name="password" size="20" value="" placeholder="不修改则不填写"/></td>
        </tr>
        <tr>
            <th width="15%">用户名称：</th>
            <td width="35%">{$member.user_name}</td>
            <th width="15%">手机号：</th>
            <td width="35%">{$member.user_moblie}</td>
        </tr>
        <tr>
            <th width="15%">最后访问时间：</th>
            <td width="35%"><div style="height:24px;line-height:24px;"><?php if(!empty($member['time'])){ echo $member['time']; }else{ echo "未知";}?></div></td>
            <th width="15%">最后访问IP：</th>
            <td width="35%"><div style="height:24px;line-height:24px;"><?php if(!empty($member['ip'])){ echo $member['ip']; }else{ echo "未知";}?></div></td>
        </tr>
        <tr>
            <th width="15%">所属企业：</th>
            <td width="35%">{$member.enter_name}</td>
            <th width="15%">管理员类型</th>
            <td width="35%"><?php if($member['u_class'] == 4){ echo "线上";}elseif($member['u_class'] == 5){ echo "线下";}?></td>
        </tr>
        <tr>
            <th width="15%">状态：</th>
            <td>
                <input type="radio" name="state" value="0" title="关闭状态" <?php if($member['is_state'] == 0){?> checked <?php }?> >
                <input type="radio" name="state" value="1" title="活动状态" <?php if($member['is_state'] == 1){?> checked <?php }?>>
            </td>
            <th width="15%">注册时间：</th>
            <td width="35%"><div style="height:24px;line-height:24px;">{$member.creatdatetime}</div></td>
        </tr>
    </table>
    <div class="btn" style="margin: 0 auto;text-align: center">
        <button class="layui-btn" lay-submit lay-filter="member">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
<script>
    layui.use('form', function () {

        var form = layui.form(),
                $ = layui.jquery;
        $("button[type=reset]").click();

        form.on('submit(member)', function (data) {

            var groupInfo = data.field;

            var url = "{:U('DealerMember/edit',['id' => $member['u_id']])}";
            $.post(url, groupInfo, function (data) {
                if (data.status == 'error') {
                    layer.msg(data.msg, {icon: 5});
                    return;
                } else {
                    layer.msg(data.msg, {
                        icon: 6,
                        time: 2000
                    }, function () {
                        location.reload();
                    });
                }
            });

            return false;
        });
    });
</script>